<template>
  <div @click="add">
<!-- 事件修饰符 -->
<!-- 语法:@事件名.修饰符 = "事件处理函数" -->
<!--.prevent.stop 阻止默认行为和冒泡 -->
    <a @click.prevent.stop="toBd" href="https://www.baidu.com">去百度</a>
  </div>
</template>

<script>
export default {
 

  data() {
    return {
      
    };
  },
  methods:{
    add(){
      console.log('点百度冒泡')
    },
    toBd(){
      console.log('点击了百度')
    }
  }



};
</script>

<style >

</style>